package com.ruoyi.wb.enmus;


import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

@ApiOperation(value = "维保计划计划类型枚举")
@Getter
@AllArgsConstructor
public enum PlanTypeEnums {

    MONTHLY("0","月"),
    QUARTER("1","季度"),
    HALF_A_YEAR("2","半年"),
    YEAR("3","年"),
    ELIGBLE("1","合格"),
    UNQUALIFIED("2","不合格"),
    UNDETECTED("","------"),
    WHIPPTREE("0","/"),
    RIGHT("1","√"),
    WRONG("2","×"),
    ONE_RANK("1","一级目录"),
    TWO_RANK("2","二级目录"),
    THREE_RANK("3","三级目录"),
    ;

    /**
     * 类型
     */
    private final String type;

    /**
     * 描述
     */
    private final String describe;


    /**
     * 获取枚举
     * @param type
     * @return
     */
    public static PlanTypeEnums getEnum(String type) {
        return Stream.of(PlanTypeEnums.values())
                .filter(p -> p.getType().equals(type))
                .findAny()
                .orElse(null);
    }

}
